﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ChainofResponsibilitySFIStudy
{
    class RunSupport
    {
        public void Run()
        {
            Support alice = new NoSupport("Alice");
            Support bob = new LimitSupport("Bob", 100);
            Support charlie = new SpecialSupport("Charlie", 100);
            Support diana = new LimitSupport("Diana", 200);
            Support elmo = new OddSuport("Elmo");
            Support fred = new LimitSupport("Fred", 300);
            //連鎖の生成
            alice.setNext(bob).setNext(charlie).setNext(diana).setNext(elmo).setNext(fred);

            //さまざまなトラブル発生
            for (int i = 0; i < 500; i++)
            {
                alice.support(new Trouble(i));
            }
        }
    }
}
